home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / GRAPHICS / SIPP_30.ZIP / LIBSIPP / BEZIER_L.L < prev    next >
Encoding:
Lex Description  |  1993-04-01  |  1.8 KB  |  65 lines

  1. %{
  2. /**
  3.  ** sipp - SImple Polygon Processor
  4.  **
  5.  **  A general 3d graphic package
  6.  **
  7.  **  Copyright Equivalent Software HB  1992
  8.  **
  9.  ** This program is free software; you can redistribute it and/or modify
  10.  ** it under the terms of the GNU General Public License as published by
  11.  ** the Free Software Foundation; either version 1, or any later version.
  12.  ** This program is distributed in the hope that it will be useful,
  13.  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.  ** GNU General Public License for more details.
  16.  ** You can receive a copy of the GNU General Public License from the
  17.  ** Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  **/
  19.  
  20. /**
  21.  ** bezier_lex.l - Lex source for reading bezier descriptions.
  22.  **/
  23.  
  24. #include "bezier.h"
  25.  
  26. extern int     atoi();
  27. extern double  atof();
  28.  
  29. extern Tokenval  tokenval;
  30. extern FILE     *bezier_file;
  31. %}
  32. %%
  33.  
  34. "bezier_patches:"       {return PATCHES;}
  35. "bezier_curves:"        {return CURVES;}
  36. "vertices:"             {return NVERTICES;}
  37. "patches:"              {return NPATCHES;}
  38. "curves:"               {return NCURVES;}
  39. "vertex_list:"          {return VERTEX_LIST;}
  40. "patch_list:"           {return PATCH_LIST;}
  41. "curve_list:"           {return CURVE_LIST;}
  42.  
  43. -?[0-9]+                {tokenval.intval = atoi(yytext);
  44.                          return INTEGER;
  45.                         }
  46. -?[0-9]+"."[0-9]*([eE][-+]?[0-9]+)?  {tokenval.floatval = atof(yytext);
  47.                                       return FLOAT;
  48.                                      }
  49.  
  50. [ \n\t]                 {}
  51. #.*$                    { /* This is a comment */ }
  52. .                       { return yytext[0]; /* We found something wrong */ }
  53.  
  54. %%
  55.  
  56. #ifndef FLEX_SCANNER
  57. int
  58. yywrap()
  59. {
  60.     return 1;
  61. }
  62. #endif
  63.  
  64.  
  65.